<body leftmargin="0" rightmargin="0" topmargin="0">
<!--application header-->
<? include "header.inc.php"; ?>
<!--EOapplication header-->

<? if ($USE_FRAME_MENU == false) { ?>
<!--left menu start-->
<div style="float: left; width:180px; height:100%; margin-right:20px;">
<?
include "menu.inc.php";
?>
</div>
<!--left menu end-->
<? } ?>

<div id="main" style=" margin-left:20px;" align="">
<!--Main start here-->
<form name="form" action="?act=approve_outing" id="daftar" method="post" onSubmit="return GoSubmit(this)">
  <br>
  <table width="750" border="0" cellpadding="2" cellspacing="0" class="tableMainBodyFont">
    <tbody>
      <tr>
        <td width="3%" align="center" bgcolor="#aaaaaa" style=" border-top-style:solid;border-top-width:1px;"><strong>Senarai Peranan</strong></td>
      </tr>
    </tbody>
  </table>
  <table width="750" class="tableMainBodyFont">
    <tr>
      <td>
      <a href="?act=user_list"></a></td>
      <td align="right"><a href="?act=new_role" style="color:blue; font-size:10px;">Tambah</a></td>
    </tr>
  </table>
  <table width="750" border="1" bgcolor="#dddddd" class="tableMainBodyFont" id="qua_table">
    <tr style=" border-bottom-style:dashed; border-bottom-width:thin;">
      <th width="15">Bil</th>
      <th width="15%">Nama Peranan </th>
      <th width="">Keterangan</th>
      <th width="">&nbsp;</th>
    </tr>
    <?
	$bil = 0;
    while ($role = pg_fetch_array($roles)) {
		$bil++;
    ?>
    <tr align="center" id="<?="row_$i"?>">
      <td align="center"><?=$bil?></td>
      <td align="left">&nbsp;
        <?=$role['name']?>
      </td>
      <td align="center"><?=$role['description']?></td>
      <td><a href="?act=edit_role&id=<?=$role[id]?>" style="color:blue; font-size:10px;">Edit</a> | 
	      <a href="javascript: confirmDelete(<?=$role[id]?>);" style="color:blue; font-size:10px;">Padam </a> |
	      <a href="?act=edit_role_menu&role_id=<?=$role[id]?>" style="color:blue; font-size:10px;">Edit Menu</a>
	  </td>
    </tr>
    <?
	  }
	  ?>
  </table>

  </form>
</div>
<!--Main end here-->
</body>
<script>
function GoSubmit(df) {
	
	if (!checkInput(icnumRegExp,document.getElementById('ic_new'),'No Kad Pengenalan Baru')) return false;
	//if (!checkInput(anythingRegExp,$('name'),'Nama Staf')) return false;
	//if (!checkSelection(strRegExp,document.getElementById('gender'),'Jantina')) return false;
	return true;
}

function checkAll(df) {
  for (i=1; i<df.elements.length; i++ )
  {
     if (df.elements[i].type == "checkbox")
     {
       df.elements[i].checked = df.checkall.checked
     } 
  }
}

function confirmDelete(userid) {
	if(confirm("Adakah anda pasti?")) {
		location = '?act=destroy_role&id=' + userid;
	}
	else return;
}


</script>

<? alert_some_message(); ?>
